#ifndef _PRIORITY_QUEUE_C_

#define _PRIORITY_QUEUE_C_

#include <stdlib.h>
#include <limits.h>
#define HEAP_ELEMENTTYPE_ERROR_VAL NULL

typedef void * HeapElement;

#define DerefAsInt(x) *((int *)x)

struct HeapStruct{
	int heap_size, heap_capacity;
	HeapElement *heap_array;
};

typedef struct HeapStruct Heap;

Heap *BuildHeap(HeapElement *source_array, int size, int heap_capacity);

int HeapInsert(Heap *h, HeapElement e);

HeapElement HeapPopMin(Heap *h);

void DisposeHeap(Heap *h);

#endif
